package com.ui;

import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;

import cn.hutool.core.collection.CollectionUtil;

public class AddDef {
	public static void main(String[] args) {
//		int begin = 41;
//		String defName = "vhdef";
//		for (int i = 0; i < 20; i++) {
//			String def = "";
//			if (i + begin < 10)
//				def = defName + "0" + (i + begin);
//			else
//				def = defName + (i + begin);
//			System.out.println("private String " + def + ";");
//		}
//		for (int i = 0; i < 20; i++) {
//			String def = "";
//			if (i + begin < 10)
//				def = defName + "0" + (i + begin);
//			else
//				def = defName + (i + begin);
//			System.out.println("public void set" + def.substring(0, 1).toUpperCase() + def.substring(1) + "(String "
//					+ def + ") {" + "this." + def + "=" + def + ";" + "}");
//			System.out.println("public String get" + def.substring(0, 1).toUpperCase() + def.substring(1) + "() {"
//					+ "		return this." + def + ";" + "	}");
//		}
		
//		String[] strs = {"delete  FROM BD_REFINFO WHERE code in  ('10H10221','10H10221L','10H10221P');","delete  FROM PUB_SYSTEMPLATE_BASE WHERE APPCODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM EXCEL_TRANSLATOR WHERE traclassname in ('nc.impl.uapbd.port.portvo.AggPortVOTranslator');","delete  FROM EXCEL_OUTPUTPROCESS WHERE BILLTYPE IN ('PORTVO_10H10221');","delete  FROM EXCEL_BILLPROCESS WHERE BILLTYPE IN ('PORTVO_10H10221');","delete  FROM SM_APPMENUITEM WHERE APPCODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM SM_APPBUTNREGISTER WHERE APPID IN (SELECT PK_APPREGISTER FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P'));","delete  FROM SM_APPPAGE WHERE PARENT_ID IN (SELECT PK_APPREGISTER FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P'));","delete  FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM PUB_PRINT_CELL WHERE CTEMPLATEID IN (SELECT CTEMPLATEID FROM PUB_PRINT_TEMPLATE WHERE APPCODE IN ('10H10221','10H10221L','10H10221P'));","delete  FROM PUB_PRINT_TEMPLATE WHERE APPCODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM PUB_FORM_PROPERTY WHERE AREAID IN (SELECT PK_AREA FROM PUB_AREA WHERE TEMPLETID IN (SELECT PK_PAGE_TEMPLET FROM PUB_PAGE_TEMPLET WHERE APPCODE IN ('10H10221','10H10221L','10H10221P')));","delete  FROM PUB_QUERY_PROPERTY WHERE AREAID IN (SELECT PK_AREA FROM PUB_AREA WHERE TEMPLETID IN (SELECT PK_PAGE_TEMPLET FROM PUB_PAGE_TEMPLET WHERE APPCODE IN ('10H10221','10H10221L','10H10221P')));","delete  FROM PUB_AREA WHERE TEMPLETID IN (SELECT PK_PAGE_TEMPLET FROM PUB_PAGE_TEMPLET WHERE APPCODE IN ('10H10221','10H10221L','10H10221P'));","delete  FROM PUB_PAGE_TEMPLET WHERE APPCODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM PUB_BCR_ELEM WHERE PK_BILLCODEBASE IN (SELECT PK_BILLCODEBASE  FROM PUB_BCR_RULEBASE WHERE NBCRCODE IN (select code  FROM PUB_BCR_NBCR WHERE metaid IN (select mdid FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P'))));","delete  FROM PUB_BCR_RULEBASE WHERE NBCRCODE IN (select code  FROM PUB_BCR_NBCR WHERE metaid IN (select mdid FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P')));","delete  FROM PUB_BCR_NBCR WHERE metaid IN (select mdid FROM SM_APPREGISTER  WHERE CODE IN ('10H10221','10H10221L','10H10221P'));","delete  FROM BD_RELATEDAPP WHERE APPCODE IN ('10H10221','10H10221L','10H10221P');","delete  FROM PUB_BUSICLASS WHERE PK_BILLTYPEID IN (select PK_BILLTYPEID FROM BD_BILLTYPE WHERE nodecode in ('10H10221','10H10221L','10H10221P'));","delete  FROM PUB_BILLACTION WHERE PK_BILLTYPEID IN (select PK_BILLTYPEID FROM BD_BILLTYPE WHERE nodecode in ('10H10221','10H10221L','10H10221P'));","delete  FROM BD_BILLTYPE WHERE nodecode in ('10H10221','10H10221L','10H10221P');"
//};
//		String[] tables = new String[strs.length] ;
//		String[] wheres = new String[strs.length] ;
//		for (int i = 0; i < wheres.length; i++) {
////			System.out.println(strs[i].substring(12));
//			String table = strs[i].substring(12,strs[i].indexOf("WHERE"));
////			System.out.println(table);
//			tables[i] = table.trim();
//			String where = strs[i].substring(strs[i].indexOf("WHERE")+5);
////			System.out.println(where);
//			wheres[i] = where.replace("('10H10221','10H10221L','10H10221P')", "?");
//		}
//		System.out.println(CollectionUtil.join(Arrays.asList(tables), "\",\""));
//		System.out.println(CollectionUtil.join(Arrays.asList(wheres), "\",\""));
		String sql = "SELECT 'INSERT INTO BD_REFINFO(CODE, DR, ISTREELAZYLOAD, ISNEEDPARA, ISSPECIALREF, LAYER, METADATANAMESPACE, METADATATYPENAME, MOBILEREFPATH, MODULENAME, NAME, PARA1, PARA2, PARA3, PK_COUNTRY, PK_INDUSTRY, PK_REFINFO, REFCLASS, REFPATH, REFSYSTEM, REFTYPE, RESERV1, RESERV2, RESERV3, RESID, RESIDPATH, TS, WHEREPART, WORKFLOWCONDITIONUSEUNITORG) VALUES ( ' ||'''' ||CODE|| ''',' ||'''' ||DR|| ''',' ||'''' ||ISTREELAZYLOAD|| ''',' ||'''' ||ISNEEDPARA|| ''',' ||'''' ||ISSPECIALREF|| ''',' ||'''' ||LAYER|| ''',' ||'''' ||METADATANAMESPACE|| ''',' ||'''' ||METADATATYPENAME|| ''',' ||'''' ||MOBILEREFPATH|| ''',' ||'''' ||MODULENAME|| ''',' ||'''' ||NAME|| ''',' ||'''' ||PARA1|| ''',' ||'''' ||PARA2|| ''',' ||'''' ||PARA3|| ''',' ||'''' ||PK_COUNTRY|| ''',' ||'''' ||PK_INDUSTRY|| ''',' ||'''' ||PK_REFINFO|| ''',' ||'''' ||REFCLASS|| ''',' ||'''' ||REFPATH|| ''',' ||'''' ||REFSYSTEM|| ''',' ||'''' ||REFTYPE|| ''',' ||'''' ||RESERV1|| ''',' ||'''' ||RESERV2|| ''',' ||'''' ||RESERV3|| ''',' ||'''' ||RESID|| ''',' ||'''' ||RESIDPATH|| ''',' ||'''' ||TS|| ''',' ||'''' ||WHEREPART|| ''',' ||'''' ||WORKFLOWCONDITIONUSEUNITORG|| '''' || ' );' FROM BD_REFINFO WHERE  CODE IN  ('10H102P','10H102L','10H10221L','10H10225P','10H10201L','10H10223L','10H10227P','10H10221P','10H10201P','10H10223P','10H10226L','10H10222','10H10201','10H10223','10H10221','10H10226','10H10227','10H10224','10H10225','10H10222L','10H10226P','10H102','10H10224L','10H10222P','10H10224P','10H10225L','10H10227L');";
		System.out.println(sql.substring(1486));
		
	}
}
